<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="后台管理系统">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/static/img/favicon.ico">
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
<body>

    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="/index">首页</a>
            <a>
                <cite>股票列表</cite>
            </a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
        </a>
    </div>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <blockquote class="layui-elem-quote mylog-info-tit">
                            <div class="layui-inline">
                                <form class="layui-form" id="userSearchForm">
                                    <div class="layui-input-inline" style="width:110px;">
                                        <select name="searchTerm" >
                                            <option value="code">股票代码</option>
                                            <option value="name">股票名字</option>
                                        </select>
                                    </div>
                                    <div class="layui-input-inline" style="width:145px;">
                                        <input type="text" name="searchContent" value="" placeholder="请输入关键字" class="layui-input search_input">
                                    </div>
                                    <a class="layui-btn searchList_btn" lay-submit lay-filter="searchFilter"><i class="layui-icon">&#xe615;</i></a>
                                </form>
                            </div>
                        </blockquote>
                    </div>
                    <div class="layui-card-body ">
                        <table class="layui-table" lay-data="{url:'/stock/list',method:'POST', page:true, loading:true, toolbar: '#toolbarDemo', id:'ItemId'}" lay-filter="ItemFilter">
                            <thead>
                                <tr>
                                    <th lay-data="{type:'checkbox', width: '2%'}">ID</th>
                                    <th lay-data="{field:'code', align:'center'}">股票代码</th>
                                    <th lay-data="{field:'name', align:'center'}">股票名字</th>
                                    <th lay-data="{field:'industry', align:'center'}">行业</th>
                                    <th lay-data="{field:'area', align:'center'}">地区</th>
                                    <th lay-data="{field:'fullname', align:'center'}">股票全称</th>
                                    <th lay-data="{field:'enname', align:'center'}">英文全称</th>
                                    <th lay-data="{field:'market', align:'center'}">市场类型</th>
                                    <th lay-data="{field:'exchange', align:'center'}">交易所代码</th>
                                    <th lay-data="{field:'curr_type', align:'center'}">交易货币</th>
                                    <th lay-data="{field:'list_status', align:'center'}">上市状态</th>
                                    <th lay-data="{field:'list_date', align:'center'}">上市日期</th>
                                    <th lay-data="{field:'delist_date', align:'center'}">退市日期</th>
                                    <th lay-data="{field:'is_hs', align:'center'}">是否沪深港通</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

<script type="text/javascript">
    var $;
    layui.config({
        base : "/static/js/"
    }).use(['form', 'table', 'layer','common'], function () {
        $ =  layui.$;
        var form = layui.form,
        table = layui.table,
        layer = layui.layer,
        common = layui.common;

        /**查询*/
        $(".searchList_btn").click(function(){
            var loading = layer.load(0,{ shade: [0.3,'#000']});
            //监听提交
            form.on('submit(searchFilter)', function (data) {
                table.reload('ItemId',{
                    where: {
                            key:data.field.searchTerm,
                            value:data.field.searchContent
                    },
                    height: 'full-140',
                    page: true,
                    done: function (res, curr, count) {
                        common.resizeGrid();
                        layer.close(loading);
                    }
                });
            });
        });

    });
</script>

<!-- 用户状态tpl-->
<script type="text/html" id="statusTpl">

    {#{% if (d.status == 1) %}
    <span class="label label-success ">有效</span>
    {% elif (d.status == 0) %}
    <span class="label label-danger ">失效</span>
    {% else %}
    {{d.status}}
    {% endif  %}#}
</script>

<!--工具条 -->
<script type="text/html" id="userBar">
    <div class="layui-btn-group">
        <a class="layui-btn layui-btn-xs user_edit" lay-event="user_edit"><i class="layui-icon larry-icon larry-bianji2"></i> 编辑</a>
    </div>
</script>

</body>
</html>